# main.py
from fastapi import FastAPI
from student_manigement.database import engine, Base
from student_manigement.students.router import router as students_router
from student_manigement.scores.router import router as scores_router
from student_manigement.employment.router import router as employment_router
from student_manigement.utils.router import router as utils_router
import uvicorn

# 创建所有表
Base.metadata.create_all(bind=engine)

app = FastAPI(title="学生管理系统", version="0.0.1")

# 包含路由
app.include_router(students_router)
app.include_router(scores_router)
app.include_router(employment_router)
app.include_router(utils_router)

@app.get("/")
def read_root():
    return {"message": "欢迎使用学生管理系统API"}

if __name__ == "__main__":
    uvicorn.run('main:app', host='localhost', port=8000, reload=True)



